package service.impl;

import dao.RatifyLessonDao;
import dao.impl.RatifyLessonDaoImpl;
import entity.RatifyLesson;
import service.RatifyLessonService;

import java.util.ArrayList;

public class RatifyLessonServiceImpl implements RatifyLessonService {
    private RatifyLessonDao dao = new RatifyLessonDaoImpl();

    @Override
    public ArrayList<RatifyLesson> findAll() throws Exception {
        return dao.findAll();
    }

    @Override
    public ArrayList<RatifyLesson> findByTeacher(String teachername) throws Exception {
        return dao.findByTeacher(teachername);
    }

    @Override
    public int approve(String code, String student, String lessoncode, String ifratify) throws Exception {
        return dao.approve(code,student,lessoncode,ifratify);
    }

    @Override
    public void addordelete(RatifyLesson rlesson, String status) throws Exception {
        dao.addordelete(rlesson,status);
    }

    @Override
    public int disapprove(String lessoncode, String student, String disapprovereason) throws Exception {
        return dao.disapprove(lessoncode, student, disapprovereason);
    }

    @Override
    public int apply(String lessoncode, String student, String applyreason) throws Exception {
        return dao.apply(lessoncode, student, applyreason);
    }
}
